package com.cmsz.upay.constant;

import org.apache.hadoop.hive.serde.serdeConstants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by le on 2017/12/18.
 */
public enum PayTradeFlowColumnEnum {

    ACTIVITY_CODE("ACTIVITY_CODE", serdeConstants.STRING_TYPE_NAME,"交易代码"),
    REQ_SYS("REQ_SYS",serdeConstants.STRING_TYPE_NAME,"发起方系统"),
    REQ_DATE("REQ_DATE",serdeConstants.STRING_TYPE_NAME,"发起方请求日期"),
    UPAY_BIZ_SEQ("UPAY_BIZ_SEQ",serdeConstants.STRING_TYPE_NAME,"YYYYMMDD"),
    REQ_TRANS_ID("REQ_TRANS_ID",serdeConstants.STRING_TYPE_NAME,"统一支付内部流水号"),
    UPAY_DATE("UPAY_DATE",serdeConstants.STRING_TYPE_NAME,"发起方时间戳"),
    UPAY_DATE_TIME("UPAY_DATE_TIME",serdeConstants.STRING_TYPE_NAME,"统一支付接收订单日期YYYYMMDD"),
    UPAY_TRANS_ID("UPAY_TRANS_ID",serdeConstants.STRING_TYPE_NAME,"统一支付接收订单时间戳YYYYMMDDHHmmss"),
    ORDER_NO("ORDER_NO",serdeConstants.STRING_TYPE_NAME,"统一支付内部流水号"),
    BUYER_ID("BUYER_ID",serdeConstants.STRING_TYPE_NAME,"[买家ID]支付宝支付时，填买家支付宝ID微信支付时，填买家的微信ID"),
    ID_TYPE("ID_TYPE",serdeConstants.STRING_TYPE_NAME,"[手机号段类型]取值范围：01 移动号段:；05 物联网号段"),
    ID_VALUE("ID_VALUE",serdeConstants.STRING_TYPE_NAME,"手机号"),
    HOME_PROV("HOME_PROV",serdeConstants.STRING_TYPE_NAME,"手机号归属省代码"),
    ORDER_MONEY("ORDER_MONEY",serdeConstants.INT_TYPE_NAME,"订单总金额"),
    PAYMENT("PAYMENT",serdeConstants.INT_TYPE_NAME,"用户支付金额，可以为0"),
    GIFT("PAYMENT",serdeConstants.INT_TYPE_NAME,"商户赠送金额， 即“红包”；单位为分"),
    MER_ACTIVITY_ID("MER_ACTIVITY_ID",serdeConstants.STRING_TYPE_NAME,"营销活动编号"),
    PAYMENT_TYPE("PAYMENT_TYPE",serdeConstants.STRING_TYPE_NAME,"支付类型包括：ALIPAY"),
    PAYMENT_LIMIT("PAYMENT_LIMIT",serdeConstants.STRING_TYPE_NAME,"支付方式限制包括：DirectPay（默认）：余额支付CreditPay：信用支付NoCredit：不允许使用信用卡"),
    PRODUCT_ID("PRODUCT_ID",serdeConstants.STRING_TYPE_NAME,"充值产品编号"),
    PRODUCT_NAME("PRODUCT_NAME",serdeConstants.STRING_TYPE_NAME,"产品名称"),
    PRODUCT_DESC("PRODUCT_DESC",serdeConstants.STRING_TYPE_NAME,"产品描述"),
    PRODUCT_URL("PRODUCT_URL",serdeConstants.STRING_TYPE_NAME,"产品展示URL"),
    NOTIFY_URL("NOTIFY_URL",serdeConstants.STRING_TYPE_NAME,"订单结果通知URL"),
    RETURN_URL("RETURN_URL",serdeConstants.STRING_TYPE_NAME,"支付成功跳转返回页面URL"),
    CLIENT_IP("CLIENT_IP",serdeConstants.STRING_TYPE_NAME,"客户端IP"),
    CUSTOM_PARAM("CUSTOM_PARAM",serdeConstants.STRING_TYPE_NAME,"保存商户自定义session"),
    WEIXIN_APPID("WEIXIN_APPID",serdeConstants.STRING_TYPE_NAME,"使用微信支付时必填[微信用户标识]用户在商户appid下的唯一标识"),
    WEIXIN_OPENID("WEIXIN_OPENID",serdeConstants.STRING_TYPE_NAME,"使用微信支付时必填[微信用户标识]用户在商户appid下的唯一标识"),
    RESULT_CODE("RESULT_CODE",serdeConstants.STRING_TYPE_NAME,"订单状态"),
    RESULT_DESC("RESULT_DESC",serdeConstants.STRING_TYPE_NAME,"订单状态描述"),
    SETTLE_DATE("SETTLE_DATE",serdeConstants.STRING_TYPE_NAME,"帐期日"),
    PAY_ORG_TRANS_ID("PAY_ORG_TRANS_ID",serdeConstants.STRING_TYPE_NAME,"支付机构流水号"),
    LAST_UPD_TIME("LAST_UPD_TIME",serdeConstants.STRING_TYPE_NAME,"最后修改时间"),
    ACC_NO("ACC_NO",serdeConstants.STRING_TYPE_NAME,"支付宝partner字段;银联mer_id字段;微信mch_id字段"),
    DEFAULT_BANK("DEFAULT_BANK",serdeConstants.STRING_TYPE_NAME,"默认网银"),
    PRODUCT_TYPE("PRODUCT_TYPE",serdeConstants.STRING_TYPE_NAME,"产品类型"),
    AUTH_CODE("AUTH_CODE",serdeConstants.STRING_TYPE_NAME,"授权码"),
    REQ_CHANNEL("REQ_CHANNEL",serdeConstants.STRING_TYPE_NAME,"请求方渠道编码");

   /*列名*/
   private String columnName;
   /*列类型*/
   private String columnType;

   private String comment;

   private PayTradeFlowColumnEnum(String columnName, String columnType, String comment){
       this.columnName=columnName;
       this.columnType=columnType;
       this.comment=comment;
   }

   /*获取所有的枚举值得kv*/
   public static Map<String,String> getAllColumnField(){
       Map<String,String> cloumnField=new HashMap<String, String>();
        for(PayTradeFlowColumnEnum _enum:values()){
            cloumnField.put(_enum.columnName,_enum.columnType);
        }
        return cloumnField;
   }

   /*获取所有列名称*/
   public  static List<String> getAllColumnName(){
       List<String> names=new ArrayList<String>();
       for(PayTradeFlowColumnEnum _enum:values()){
           names.add(_enum.columnName);
       }
       return names;
   }
}
